import request from '@/helpers/request';

// 获取所有车辆事故记录
export const getAllRecords = (data) => {
  return request('/api/accidentRecord/getAllRecords', {
    method: 'GET',
  });
};

// 获取单条车辆事故记录
export const getOneRecords = (data) => {
  return request('/api/accidentRecord/getOneRecords?accidentId=' + data.id, {
    method: 'GET',
  });
};

// 根据汽车编号获取事故记录
export const getRecordByVehicleId = (data) => {
  return request(
    '/api/accidentRecord/getRecordByVehicleId?vehicleId=' + data.id,
    {
      method: 'GET',
    },
  );
};

// 删除车辆事故记录
export const deleteRecord = (data) => {
  return request('/api/accidentRecord/deleteRecord?accidentId=' + data.id, {
    method: 'GET',
  });
};

// 添加车辆事故记录
export const addRecord = (params) => {
  return request('/api/accidentRecord/addRecord', {
    method: 'POST',
    params,
  });
};

// 编辑修改车辆事故记录
export const updateRecord = (params) => {
  return request('/api/accidentRecord/updateRecord', {
    method: 'POST',
    params,
  });
};
